export const getLabel = (
  type = "success",
  title = "标题",
  content = "0",
  unit = "",
  value = 0
) => {
  return { type, title, content, unit, value };
};
export const playerPois = () => {
  return {
    pois: [
      {
        id: "poi1",
        type: 2,
        show_distance: [-1],
        position_type: 0,
        position: [-13371.333984375, 6493.28369140625, 3050.60205078125],
        icon: "https://s1.ax1x.com/2022/11/07/xjzJyD.png",
        icon_size: [10, 10],
        show_name: true,
        name: "摄像头",
        show_name_distance: [-1],
        name_font_size: 6,
        name_font_color: [255, 255, 255, 255],
        name_bg_color: [0, 0, 0, 255],
        data: "{}",
        show_type: 0,
      },
      {
        id: "JIzhu07",
        type: 3,
        show_distance: [-1],
        position_type: 0,
        position: [-6989.2685546875, 14725.4248046875, 3117.2099609375],
        icon: "https://s1.ax1x.com/2022/11/07/xjvXDJ.png",
        icon_size: [10, 10],
        show_name: true,
        name: "服务器",
        show_name_distance: [-1],
        name_font_size: 6,
        name_font_color: [255, 255, 255, 255],
        name_bg_color: [100, 0, 0, 255],
        data: [{ name: "服务器1" }, { name: "服务器2" }, { name: "服务器1" }],
        show_type: 0,
      },
      {
        id: "poik",
        type: 1,
        show_distance: [-1],
        position_type: 0,
        position: [-4376.7294921875, -6445.02197265625, 2202.309814453125],
        icon: "https://s1.ax1x.com/2022/11/07/xjxS4x.png",
        icon_size: [10, 10],
        show_name: true,
        name: "空调",
        show_name_distance: [-1],
        name_font_size: 6,
        name_font_color: [255, 255, 255, 255],
        name_bg_color: [23, 0, 0, 255],
        data: "{}",
        show_type: 0,
      },
      {
        id: "power1",
        type: 4,
        show_distance: [-1],
        position_type: 0,
        position: [-13321.94238281255, 22419.525390625, 3454.48779296875],
        icon: "https://s1.ax1x.com/2022/11/07/xvSPne.png",
        icon_size: [10, 10],
        show_name: true,
        name: "电柜",
        show_name_distance: [-1],
        name_font_size: 6,
        name_font_color: [255, 255, 255, 255],
        name_bg_color: [23, 0, 0, 255],
        data: "{}",
        show_type: 0,
      },
    ],
  };
};

export const serverList = () => {
  return [
    [
      {
        id: "server1",
        name: "服务器01",
        mem: "90",
        cpu: "20",
        system: "Windows",
      },
    ],
  ];
};

export const jiguiList = () => {
  return [
    [
      {
        id: "server1",
        name: "编号001",
        mem: "90",
        cpu: "20",
        system: "Windows",
      },
      {
        id: "server1",
        name: "编号002",
        mem: "90",
        cpu: "20",
        system: "Windows",
      },
      {
        id: "server1",
        name: "编号003",
        mem: "90",
        cpu: "20",
        system: "Windows",
      },
      {
        id: "server1",
        name: "编号004",
        mem: "90",
        cpu: "20",
        system: "Windows",
      },
      {
        id: "server1",
        name: "编号005",
        mem: "90",
        cpu: "20",
        system: "Windows",
      },
      {
        id: "server1",
        name: "编号006",
        mem: "90",
        cpu: "20",
        system: "Windows",
      },
    ],
  ];
};

export const soureList = () => {
  return new Promise(async (resolve, reject) => {
    try {
      resolve([
        getLabel("primary", "机房名称", "机房", ""),
        getLabel("primary", "属性", "自建", ""),
        // getLabel("primary", "所属", "广宽公司", ""),
      ]);
    } catch (e) {
      reject(e);
    }
  });
};

export const infoList = () => {
  return new Promise(async (resolve, reject) => {
    try {
      resolve([
        getLabel("primary", "机柜", "6", "个", 0),
        getLabel("success", "空调", "2", "个", 1),
        getLabel("primary", "摄像头", "6", "个", 2),
        getLabel("warning", "服务器", "240", "台", 3),
        getLabel("warning", "电柜", "1", "个", 4),
      ]);
    } catch (e) {
      reject(e);
    }
  });
};

export const warningList = () => {
  return new Promise(async (resolve, reject) => {
    try {
      resolve([
        getLabel("warning", "湿度", "2", "个", 0),
        getLabel("warning", "温度", "1", "个", 1),
        getLabel("warning", "cpu", "3", "个", 2),
        getLabel("warning", "内存", "6", "个", 3),
        getLabel("warning", "电流", "2", "个", 4),
        getLabel("warning", "电压", "0", "个", 5),
      ]);
    } catch (e) {
      reject(e);
    }
  });
};
